
package com.seekting.study;

import com.google.gson.Gson;

public class JsonTest {

    public static void main(String[] args) {

        GJson json = new GJson();
        json.setType(1);
        SubGGJson subGGJson = new SubGGJson();
        subGGJson.setAge(11);
        subGGJson.setName("xxx");
        json.setJson(subGGJson);
        Gson gson = new Gson();
        String str = gson.toJson(json);

        Gson gson1 = new Gson();
        GJson xx = gson1.fromJson(str, GJson.class);
        GGJson vv = xx.getGGJson();
        boolean is = vv instanceof SubGGJson;
        System.out.println(is);
    }
}
